{extend name="admin/public/base" /}

{block name="content"}
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    缓存更新
    <small></small>
  </h1>
  <ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="#">系统</a></li>
    <li class="active">缓存更新</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">

    <div class="box box-solid">
        <div class="box-body table-responsive">
            {volist name="data" id="vo"}
              <a href="javascript:;" class="btn btn-app" onclick="apply('{$vo.url}')">
                <i class="fa fa-file-image-o"></i> {$vo.title}
              </a>
            {/volist}
        </div>
        <div class="box-footer">

        </div>
    </div>

</section>
<!-- /.content -->
{/block}

{block name="js"}
<script>
function apply(url){
    $.ajax({
        url:url,
        type:'get',
        dataType:'json',
        success:function(xhr){
            if(xhr.code == 200){
                swal({
                    title: xhr.msg,
                    text: "",
                    type: "success",
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                });
            } else{
                swal({
                    title: xhr.msg,
                    text: "",
                    type: "error",
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                });
            }
        }
    });
}
</script>
{/block}
